public class Student {
    private String id;
    private String name;
    private String gender;
    private String major;

    public Student(String id, String name, String gender, String major) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.major = major;
    }
    // Setters
    public void setId(String id) {
        this.id = id;
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setGender(String gender) {
        this.gender = gender;
    }
    public void setMajor(String major) {
        this.major = major;
    }
    // Getters
    public String getId() { return id; }
    public String getName() { return name; }
    public String getGender() { return gender; }
    public String getMajor() { return major; }
    // toString
    @Override
    public String toString() {
        return String.format("学号:%s, 姓名:%s, 性别:%s, 专业:%s", id, name, gender, major);
    }
}
